<%@ page contentType="text/html;charset=UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>

<head>
    <title>管理员管理界面</title>
    <script type="text/javascript">
        function del(applyID) {
            if (window.confirm("好哥们，确定要删除吗？（删除了之后可是不可恢复的哦）")) {
                document.location.href = "delete?applyID=" + applyID;
            }
        }
    </script>
</head>

<body>
<h1>${sessionScope.UserMessage.userId}管理员，欢迎登录</h1>
<h1>欢迎管理出校申请</h1>
<br>
<a href="${pageContext.request.contextPath}/logout">[安全退出]</a>

<table align="center" border="1" width="70%">
    <tr>
        <th>出校申请序号</th>
        <th>提交用户ID</th>
        <th>提交时间</th>
        <th>申请时长（小时）</th>
        <th>审批状态（P,R,A）</th>
        <th>执行操作</th>
    </tr>
    <c:forEach items="${requestScope.MessageList}" var="message" varStatus="messageStatus">
        <tr>
            <td align="center">${messageStatus.count}</td>
            <td align="center">${message.userId}</td>
            <td align="center">${message.submitTime}</td>
            <td align="center">${message.wantTime}</td>
            <td align="center">${message.result}</td>
            <td align="center">
                <a href="decide?result=Accepted&applyID=${message.applyId}">同意</a>
                <a href="decide?result=Rejected&applyID=${message.applyId}"> 拒绝</a>
                <a href="javascript:void(0)" onclick="del('${message.applyId}')"> 删除</a>
            </td>
        </tr>
    </c:forEach>


    <c:choose>
        <c:when test="sdf">

        </c:when>

        <c:otherwise>

        </c:otherwise>
    </c:choose>


</table>

</body>
</html>
